/*	Copyright (c) 2010 MIEM (http://miem.edu.ru/)
 *
 *	Authors:
 *		* Andrey Shtykovskiy    ( ashty@itas.miem.edu.ru      )
 *		* Edward Klyshinsky     ( klyshinsky@itas.miem.edu.ru )
 *		* Sergey R. Tumkovsky   ( srt@itas.miem.edu.ru        )
 *
 *	This file is part of MOAN (morphology analysis) software.
 *
 *	MOAN is free software: you can redistribute it and/or modify it 
 *	under the terms of the GNU General Public License as published 
 *	by the Free Software Foundation, either version 3 of the License, 
 *	or (at your option) any later version.
 *
 *	This library is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *	Lesser General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License 
 *	along with MOAN. If not, see http://www.gnu.org/licenses/.
 */

#ifndef __CATEGORY_HPP_GUARD__
#define __CATEGORY_HPP_GUARD__

#include <assert.h>

#include <string>

namespace moan {

	template< typename grammeme_t >
	class category {

	public:
		typedef grammeme_t grammeme_type;

		category(const char* name_) {
			_name.assign(name_);
		}

		const char* name() const {
			return _name.c_str();
		}

		void set_grammeme(
			const grammeme_type& grammeme_, 
			unsigned int position_, 
			unsigned int bits_				) {
			
				_grammeme.from(grammeme_);			
				_position = position_;
				_bits = bits_;
		}

		const grammeme_type& grammeme() const {			
			return _grammeme;
		}

		unsigned int position() const {
			return _position;
		}

		unsigned int bits() const {
			return _bits;
		}

	private:

		unsigned int _position;
		unsigned int _bits;

		std::string _name;
		grammeme_type _grammeme;

	}; /* class category */

} /* namespace moan */

#endif /* __CATEGORY_HPP_GUARD__ */